#ifndef SYSSETTINGMODEL_H
#define SYSSETTINGMODEL_H
#include "databasemanager.h"

#include<QObject>
enum CMD_TYPE{
    CMD_TYPE_NONE = 0,
    CMD_TYPE_UPPER = 1,
    CMD_TYPE_GLOBAL = 2
};

class SysSettingModel: public QObject
{
    Q_OBJECT
public:
    static SysSettingModel * getInstance();

    bool bShowVirtualBtns() const;
    bool bShowJoystickBtns() const;
    void setOtherConfig(bool bShowVirtualBtns,bool bShowJoystickBtns, QString strTelemetryFolder);

    QList<Command> * upperLimbCmdList();
    QList<Command> upperLimbCmdList(int nParentID);
    void setUpperLimbCmdList(QList<Command> &newCmdList);
    Command * getUpperLimbCmd(int nCmdID);

    QList<Command> * globalCmdList();
    QList<Command> globalCmdList(int nParentID);
    void setGlobalCmdList(QList<Command> &newCmdList);
    Command * getGlobalCmd(int nCmdID);
    CMD_TYPE getCmdByName(QString strName, Command& cmd);
    CMD_TYPE getCmdByHotKey(FUNCTION_KEY nFuncKey,STICK_KEY nHotKey, Command& cmd);


    QList<AudioFile> * audioFileList();
    void setAudioFileList(QList<AudioFile> &newFileList);
    bool getAudioByHotKey(FUNCTION_KEY nFuncKey,STICK_KEY nHotKey, AudioFile& file);




    QString strTelemetryFolder() const;

signals:
    void showVirtualCtrlBtnChanged();
    void showJoystickBtnChanged();
    void strTelemetryFolderChanged();
    void upperLimbCmdChanged();
    void globalCmdChanged();
    void audioFileChanged();
private:
    SysSettingModel(QObject *parent=nullptr);
    static SysSettingModel * m_pInstance;

    bool m_bShowVirtualBtns;
    bool m_bShowJoystickBtns;
    QString m_strTelemetryFolder;
    QList<Command> m_upperLimbCmdList;
    QList<Command> m_globalCmdList;
    QList<AudioFile> m_audioFileList;

};

#endif // SYSSETTINGMODEL_H
